<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改工作经历')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-working-edit" class="form-horizontal" AUTOCOMPLETE="OFF">
        <input name="id" type="hidden" id="id" th:value="${working.id}"/>
        <h4 class="form-header h4">工作经历</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">开始时间：</label>
                    <div class="col-sm-8">
                        <input name="begindate" id="begindate"th:value="${working.begindate}" class="form-control laydate-demo-1" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">结束时间：</label>
                    <div class="col-sm-8">
                        <input name="EndDate" id="EndDate"th:value="${working.enddate}"  class="form-control laydate-demo-2" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">工作单位：</label>
                    <div class="col-sm-8">
                        <input name="Company" id="Company"th:value="${working.company}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">担任职务：</label>
                    <div class="col-sm-8">
                        <input name="Job" id="Job"th:value="${working.job}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>


        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">工作地点：</label>
                    <div class="col-sm-8">
                        <input name="WorkPlace" id="WorkPlace"th:value="${working.workplace}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">证明人：</label>
                    <div class="col-sm-8">
                        <input name="Reference" id="Reference"th:value="${working.Reference}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>


        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">联系方式：</label>
                    <div class="col-sm-8">
                        <input name="Tel" id="Tel"th:value="${working.Tel}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">是否海外：</label>
                    <div class="col-sm-8">
                        <select name="isout" id="isout" class="form-control m-b">
                            <option value="">请选择</option>
                            <option value="0" th:selected="${working.isout == false}">否</option>
                            <option value="1" th:selected="${working.isout == true}">是</option>
                        </select></div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">备注：</label>
                    <div class="col-sm-8">
                        <input name="Remark" id="Remark"th:value="${working.remark}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "entryManage/EntryBackground";

    $(function () {

        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });
        });
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-working-edit").serializeArray();

            var id = $("#id").val();

            //开始时间
            var begindate = $("#begindate").val();

            //结束时间
            var EndDate = $("#EndDate").val();

            //工作单位
            var Company = $("#Company").val();

            //担任职务
            var Job = $("#Job").val();

            //工作地点
            var WorkPlace = $("#WorkPlace").val();

            //证明人
            var Reference = $("#Reference").val();

            //联系方式
            var Tel = $("#Tel").val();

            //是否海外
            var isout = $("#isout").val();

            //备注
            var Remark = $("#Remark").val();

            data.push({"name": "id", "value": id});
            data.push({"name": "begindate", "value": begindate});
            data.push({"name": "EndDate", "value": EndDate});
            data.push({"name": "Company", "value": Company});
            data.push({"name": "Job", "value": Job});
            data.push({"name": "WorkPlace", "value": WorkPlace});
            data.push({"name": "Reference", "value": Reference});
            data.push({"name": "Tel", "value": Tel});
            data.push({"name": "isout", "value": isout});
            data.push({"name": "Remark", "value": Remark});
            $.operate.save(prefix + "/editWorking", data);
        }
    }


</script>
</body>
</html>
